Position detecting method and position detecting apparatus in consideration of non-pinhole characteristic of a camera

ABSTRACT

A position detection method and a position detection device for detecting with sufficient accuracy the position or the attitude of an object by using an image of the object captured by a single camera. The position detection method detects the position or the attitude of the object by using a measurement pixel position in images of multiple points on the object, which images are captured by the single camera and have a known positional relationship. The method has a step of acquiring, without consideration of non-pinhole camera properties of the camera and based on the positional relationship between the multiple points and on the measurement pixel position, a position matrix representing rotation and translation of the object, a step of obtaining, with consideration of the non-pinhole camera properties of the camera, a correction pixel position corresponding to the measurement pixel position, a step of adjusting the position matrix so that a difference between the correction pixel position and the measurement pixel position is within a permissible range, and a step of defining, as the estimated position of the object, the position corresponding to the adjusted position matrix.

TECHNICAL FIELD

The present invention relates to a position detecting method and a position detecting apparatus for detecting a position or an attitude of an object from an object image.

BACKGROUND ART

Conventionally, plural cameras are used to take an object image in the position detecting method and position detecting apparatus for detecting the position or attitude of the object from the object image (for example, see Patent Document 1). Accordingly, the drawbacks are a complicated configuration and a large size of the apparatus.

On the other hand, there has also been proposed a position detecting method and a position detecting apparatus for detecting the position or attitude of the object from the object image taken by one camera. However, the position or attitude cannot be detected with a sufficient accuracy.

-   Patent Document 1: Japanese Patent laid-Open Publication No.     2004-309318

Accordingly, there is a need for the position detecting method and position detecting apparatus for detecting the position or attitude of the object with sufficient accuracy from the object image taken by one camera.

DISCLOSURE OF THE INVENTION

In a position detecting method according to the invention, a position or an attitude of an object is detected from measured pixel positions in an image of a plurality of points on the object in consideration of a non-pinhole characteristic of a camera, the image being taken with one camera, the plurality of points on the object being in a known positional relationship. The position detecting method according to the invention includes the steps of obtaining a position matrix indicating rotation and translation of the object from the measured pixel position and a positional relationship between the plurality of points without considering the non-pinhole characteristic of the camera; and obtaining a corrected pixel position corresponding to one of the measured pixel positions in consideration of the non-pinhole characteristic of the camera. The position detecting method according to the invention includes the steps of adjusting the position matrix such that a distance between the corrected pixel position and the measured pixel position falls within an allowable range; and setting a position corresponding to the position matrix at the object position estimated in consideration of the non-pinhole characteristic of the camera, the position matrix being adjusted such that the distance between the corrected pixel position and the measured pixel position falls within an allowable range.

In the position detecting method according to the invention, the position matrix obtained without considering the non-pinhole characteristic of the camera is adjusted such that the distance between the pixel position corrected in consideration of the non-pinhole characteristic of the camera and the measured pixel position falls within the allowable range, so that the position or attitude of the object can be detected with a sufficient accuracy from the object image taken with one camera.

In the position detecting method according to an embodiment of the invention, an element of the position matrix is adjusted so as to have orthogonality, the element expressing the rotation of the object.

According to the embodiment, the accuracy of object position detection is improved because the orthogonality of the position matrix is ensured.

In the position detecting method according to another embodiment of the invention, correction is performed for the non-pinhole characteristic of the camera using calibration data defined for each pixel position.

According to the embodiment, because the non-pinhole characteristic of the camera is corrected using the calibration data defined for each pixel position, the accuracy of object position detection is improved without complicated procedure.

A position detecting apparatus according to the invention that detects a position or an attitude of an object, includes image obtaining means for obtaining an image of a plurality of points on the object, the image being taken with one camera, the plurality of points being in a known positional relationship; pixel position detecting means for detecting measured pixel positions of the plurality of points in the image; and object position estimating means for detecting the object position from the measured pixel positions of the plurality of points and a positional relationship between the plurality of points. The object position estimating means obtains a position matrix indicating rotation and translation of the object from the measured pixel positions and a positional relationship between the plurality of points without considering the non-pinhole characteristic of the camera, and obtains a corrected pixel position corresponding to one of the measured pixel positions in consideration of the non-pinhole characteristic of the camera. The object position estimating means adjusts the position matrix such that a distance between the corrected pixel position and the measured pixel position falls within an allowable range, and sets a position corresponding to the position matrix at the object position estimated in consideration of the non-pinhole characteristic of the camera, the position matrix being adjusted such that the distance between the corrected pixel position and the measured pixel position falls within an allowable range.

In the position detecting apparatus according to the invention, the object position estimating means adjusts the position matrix obtained without considering the non-pinhole characteristic of the camera such that the distance between the pixel position corrected in consideration of the non-pinhole characteristic of the camera and the measured pixel position falls within the allowable range, so that the position or attitude of the object can be detected with a sufficient accuracy from the object image taken with one camera.

The position detecting apparatus according to an embodiment of the invention further includes calibration data storage means in which calibration data defined for each pixel position is stored, and the object position estimating means performs correction for the non-pinhole characteristic of the camera using the calibration data.

Thus, because correction is performed for the non-pinhole characteristic of the camera using the calibration data stored in the calibration data storage means, the accuracy of object position detection is improved with no complicated procedure.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a view illustrating a configuration of a position detecting apparatus according to an embodiment of the invention.

FIG. 2 is a view illustrating a relationship between a position (X,Y,Z) on an object and a position on an image, that is, a pixel position (u,v,1).

FIG. 3 is a flowchart illustrating a method in which object position estimating means obtains an object position estimated in consideration of a non-pinhole characteristic of a camera.

FIG. 4 is a view for explaining the non-pinhole characteristic of the camera.

FIG. 5 is a view for explaining a method for obtaining a corrected pixel position through a first correction.

FIG. 6 is a view for explaining a method for obtaining a corrected pixel position through a second correction.

FIG. 7 is a view for explaining a method for obtaining a corrected pixel position through a third correction.

FIG. 8 is a view illustrating an error that is generated when a position is detected without considering the non-pinhole characteristic of the camera while a plate glass is placed in front of a pinhole.

FIG. 9 is a view illustrating an error that is generated when the position is detected by a position detecting method of the invention on the same condition as that of FIG. 8.

FIG. 10 is an explanatory view for explaining contents of calibration data.

BEST MODE FOR CARRYING OUT THE INVENTION

FIG. 1 is a view illustrating a configuration of a position detecting apparatus 100 according to an embodiment of the invention. The position detecting apparatus 100 includes image obtaining means 101, pixel position detecting means 103, object position estimating means 105, and calibration data storage means 107.

The image obtaining means 101 obtains and stores an image of positions of plural points on an object. The image of positions is taken by one camera 109. At this point, the plural points are in a known positional relationship. Markers 108 may be added the plural points so that an image of the markers can be taken.

The pixel position detecting means 103 detects pixel positions of the plural points in the image obtained by the image obtaining means 101.

The calibration data storage means 107 stores calibration data corresponding to the pixel positions therein.

The object position estimating means 105 estimates an object position using the pixel positions of the plural points and the pieces of calibration data corresponding to the pixel positions.

FIG. 2 is a view illustrating a relationship between a position (X,Y,Z) on the object and a position on the image, that is, a pixel position (u,v,1).

The transform of the position (X,Y,Z) on the object into the position (u,v,1) on the image is expressed as follows while divided into a position matrix P indicating rotation and translation of the object and a projection transform matrix w.

$\begin{matrix} {{P = \begin{pmatrix} P_{11} & P_{12} & P_{13} & P_{14} \\ P_{21} & P_{22} & P_{23} & P_{24} \\ P_{31} & P_{32} & P_{33} & P_{34} \end{pmatrix}}\mspace{14mu}{\begin{pmatrix} T_{x} \\ T_{y} \\ T_{z} \end{pmatrix} = {P\begin{pmatrix} X \\ Y \\ Z \\ 1 \end{pmatrix}}}\mspace{14mu}{{w\begin{pmatrix} u \\ v \\ 1 \end{pmatrix}} = \begin{pmatrix} T_{x} \\ T_{y} \\ T_{z} \end{pmatrix}}} & \left\lbrack {{Formula}\mspace{14mu} 1} \right\rbrack \end{matrix}$

When an initial position and an attitude of the object are matched with a position and an attitude of the camera, the position matrix P indicates the position and attitude of the object. Accordingly, the object position can be estimated by obtaining the position matrix P.

The object position estimating means 105 obtains the position matrix P to estimate the object position. A function of the object position estimating means 105 will be described below.

Method for Obtaining Position Matrix

First a method for obtaining the position matrix P will be described. Assuming that the projection transform matrix w and the position matrix P are expressed by Formulas 2 and 3, Formula 4 is obtained.

$\begin{matrix} {{{w\begin{pmatrix} u \\ v \\ 1 \end{pmatrix}} = {P\begin{pmatrix} X \\ Y \\ Z \\ 1 \end{pmatrix}}}\begin{matrix} {P = \begin{pmatrix} P_{11} & P_{12} & P_{13} & P_{14} \\ P_{21} & P_{22} & P_{23} & P_{24} \\ P_{31} & P_{32} & P_{33} & P_{34} \end{pmatrix}} \\ {= {P_{34}\begin{pmatrix} \frac{P_{11}}{P_{34}} & \frac{P_{12}}{P_{34}} & \frac{P_{13}}{P_{34}} & \frac{P_{14}}{P_{34}} \\ \frac{P_{21}}{P_{34}} & \frac{P_{22}}{P_{34}} & \frac{P_{23}}{P_{34}} & \frac{P_{23}}{P_{34}} \\ \frac{P_{31}}{P_{34}} & \frac{P_{32}}{P_{34}} & \frac{P_{33}}{P_{34}} & 1 \end{pmatrix}}} \\ {= {P_{34}\begin{pmatrix} a_{11} & a_{12} & a_{13} & a_{14} \\ a_{21} & a_{22} & a_{23} & a_{24} \\ a_{31} & a_{32} & a_{33} & 1 \end{pmatrix}}} \end{matrix}} & \left\lbrack {{Formula}\mspace{14mu} 2} \right\rbrack \\ {\frac{w}{P_{34}} = W} & \left\lbrack {{Formula}\mspace{14mu} 3} \right\rbrack \\ {{W\begin{pmatrix} u \\ v \\ 1 \end{pmatrix}} = {\begin{pmatrix} a_{11} & a_{12} & a_{13} & a_{14} \\ a_{21} & a_{22} & a_{23} & a_{24} \\ a_{31} & a_{32} & a_{33} & 1 \end{pmatrix}\begin{pmatrix} X \\ Y \\ Z \\ 1 \end{pmatrix}}} & \left\lbrack {{Formula}\mspace{14mu} 4} \right\rbrack \end{matrix}$

Formula 4 is expressed as follows: Wu=a ₁₁ X+a ₁₂ Y+a ₁₃ Z+a ₁₄ Wv=a ₂₁ X+a ₂₂ Y+a ₂₃ Z+a ₂₄ W=a ₃₁ X+a ₃₂ Y+a ₃₃ Z+1  [Formula 5]

When W is substituted into the equations including u and v, Formula 6 is obtained.

$\begin{matrix} {{u = \frac{{a_{11}X} + {a_{12}Y} + {a_{13}Z} + a_{14}}{{a_{31}X} + {a_{32}Y} + {a_{33}Z} + 1}}{v = \frac{{a_{21}X} + {a_{22}Y} + {a_{23}Z} + a_{24}}{{a_{31}X} + {a_{32}Y} + {a_{33}Z} + 1}}} & \left\lbrack {{Formula}\mspace{14mu} 6} \right\rbrack \end{matrix}$

At this point, because Formula 7 is known by the measurement, the number of unknowns becomes 11 as illustrated by Formula 8. X,Y,Z,u,v  [Formula 7] a ₁₁ ,a ₁₂ ,a ₁₃ ,a ₁₄ ,a ₂₁ ,a ₂₂ ,a ₂₃ ,a ₂₄ ,a ₃₁ ,a ₃₂ ,a ₃₃  [Formula 8]

However, the unknowns expressed by Formula 9 are orthogonal. a ₁₁ ,a ₁₂ ,a ₁₃ ,a ₂₁ ,a ₂₂ ,a ₂₃ ,a ₃₁ ,a ₃₂ ,a ₃₃  [Formula 9]

A linear equation relating to a is expressed by Formula 10. Xa ₁₁ +Ya ₁₂ +Za ₁₃ +a ₁₄ −uXa ₃₁ −uYa ₃₂ −uZa ₃₃ =u Xa ₂₁ +Ya ₂₂ +Za ₂₁ +a ₂₄ −vXa ₃₁ −vYa ₃₂ −vZa ₃₃ =v  [Formula 10]

At this point, assuming that the point (X,Y,Z) is located on a plane of Z=0, because Formula 11 is obtained, the number of unknowns becomes eight as illustrated by Formula 12, and the eight unknowns can be determined from numerical values of (X,Y) and (u,v) for four points. Xa ₁₁ +Ya ₁₂ +a ₁₄ −uXa ₃₁ −uYa ₃₂ =u Xa ₂₁ +Ya ₂₂ +a ₂₄ −vXa ₃₁ −vYa ₃₂ =v  [Formula 11] a ₁₁ ,a ₁₂ ,a ₁₄ ,a ₂₁ ,a ₂₂ ,a ₂₄ ,a ₃₁ ,a ₃₂  [Formula 12]

Assuming that the three-dimensional coordinates at the four point and the two-dimensional coordinates on the screen are projected as illustrated by Formula 13, Formula 15 can be obtained by solving Formula 14. (X ₁ ,Y ₁,0)→(u ₁ ,v ₁) (x ₂ ,Y ₂,0)→(u ₂ ,v ₂) (X ₃ ,Y ₃,0)→(u ₃ ,v ₃) (X ₄ ,Y ₄,0)→(u ₄ ,v ₄)  [Formula 13]

$\begin{matrix} {\begin{pmatrix} u_{1} \\ v_{1} \\ u_{2} \\ v_{2} \\ u_{3} \\ v_{3} \\ u_{4} \\ v_{4} \end{pmatrix} = {\begin{pmatrix} X_{1} & Y_{1} & 1 & 0 & 0 & 0 & {{- u_{1}}X_{1}} & {{- u_{1}}Y_{1}} \\ 0 & 0 & 0 & X_{1} & Y_{1} & 1 & {{- v_{1}}X_{1}} & {{- v_{1}}Y_{1}} \\ X_{2} & Y_{2} & 1 & 0 & 0 & 0 & {{- u_{2}}X_{2}} & {{- u_{2}}Y_{2}} \\ 0 & 0 & 0 & X_{2} & Y_{2} & 1 & {{- v_{2}}X_{2}} & {{- v_{2}}Y_{2}} \\ X_{3} & Y_{3} & 1 & 0 & 0 & 0 & {{- u_{3}}X_{3}} & {{- u_{3}}Y_{3}} \\ 0 & 0 & 0 & X_{3} & Y_{3} & 1 & {{- v_{3}}X_{3}} & {{- v_{3}}Y_{3}} \\ X_{4} & X_{4} & 1 & 0 & 0 & 0 & {{- u_{4}}X_{4}} & {{- u_{4}}Y_{4}} \\ 0 & 0 & 0 & X_{4} & Y_{4} & 1 & {{- v_{4}}X_{4}} & {{- v_{4}}Y_{4}} \end{pmatrix}\begin{pmatrix} a_{11} \\ a_{12} \\ a_{14} \\ a_{21} \\ a_{22} \\ a_{24} \\ a_{31} \\ a_{32} \end{pmatrix}}} & \left\lbrack {{Formula}\mspace{14mu} 14} \right\rbrack \end{matrix}$ a ₁₁ ,a ₁₂ ,a ₁₄ ,a ₂₁ ,a ₂₂ ,a ₂₄ ,a ₃₁ ,a ₃₂  [Formula 15]

Formula 16 is obtained from Formula 17 because of orthogonality. a ₁₃ , a ₂₃ , a ₃₃  [Formula 16] a ₁₁ ,a ₁₂ ,a ₁₄ ,a ₂₁ ,a ₂₂ ,a ₂₄ ,a ₃₁ ,a ₃₂  [Formula 17]

Formula 18 is obtained from Formula 20 by using Formula 19. P ₃₄  [Formula 18]

$\begin{matrix} {\sqrt{a_{11}^{2} + a_{12}^{2} + a_{13}^{2}} = {\sqrt{a_{21}^{2} + a_{22}^{2} + a_{23}^{2}} = \frac{1}{P_{34}}}} & \left\lbrack {{Formula}\mspace{14mu} 19} \right\rbrack \\ {P_{34} = \frac{2}{\sqrt{a_{11}^{2} + a_{12}^{2} + a_{13}^{2}} + \sqrt{a_{21}^{2} + a_{22}^{2} + a_{23}^{2}}}} & \left\lbrack {{Formula}\mspace{14mu} 20} \right\rbrack \end{matrix}$

The position matrix P indicating the position and attitude is determined by the above-described procedure. However, as can be seen from the above-described procedure, the unknowns expressed by Formula 21 have no relation with one another, the orthogonality is not ensured. a ₁₁ ,a ₁₂ ,a ₁₄ ,a ₂₁ , a ₂₂ ,a ₂₄ , a ₃₁ , a ₃₂  [Formula 21] Method for Obtaining Position Matrix Having Orthogonality

A method for obtaining the position matrix having the orthogonality will be described below.

A rotation angle θ is obtained from the obtained position matrix P. Because the angle is obtained from partial values, the angle is not an optimum angle. Therefore, the obtained angle and translation component are set at initial values, and the optimum angle and translation component are obtained by non-linear minimization.

Formula 22 is obtained when the object is rotated in the order of θz→θx→θy (−180<θz≦180, −90<θx≦90, −180<θy≦180).

$\begin{matrix} \begin{matrix} {P = \begin{pmatrix} P_{11} & P_{12} & P_{13} & P_{14} \\ P_{21} & P_{22} & P_{23} & P_{24} \\ P_{31} & P_{32} & P_{33} & P_{34} \end{pmatrix}} \\ {= \begin{pmatrix} \begin{matrix} {{\cos\;\theta_{y}\cos\;\theta_{z}} +} \\ {\sin\;\theta_{x}\sin\;\theta_{y}\sin\;\theta_{z}} \end{matrix} & \begin{matrix} {{{- \cos}\;\theta_{y}\sin\;\theta_{z}} +} \\ {\sin\;\theta_{x}\sin\;\theta_{y}\cos\;\theta_{z}} \end{matrix} & {\cos\;\theta_{x}\sin\;\theta_{y}} & P_{14} \\ {\cos\;\theta_{x}\sin\;\theta_{z}} & {\cos\;\theta_{x}\cos\;\theta_{z}} & {{- \sin}\;\theta_{x}} & P_{24} \\ \begin{matrix} {{{- \sin}\;\theta_{y}\cos\;\theta_{z}} +} \\ {\sin\;\theta_{x}\cos\;\theta_{y}\sin\;\theta_{z}} \end{matrix} & \begin{matrix} {{\sin\;\theta_{y}\sin\;\theta_{z}} +} \\ {\sin\;\theta_{x}\cos\;\theta_{y}\cos\;\theta_{z}} \end{matrix} & {\cos\;\theta_{x}\cos\;\theta_{y}} & P_{34} \end{pmatrix}} \end{matrix} & \left\lbrack {{Formula}\mspace{14mu} 22} \right\rbrack \end{matrix}$

Therefore, the relationship between the position matrix P and the rotation angle is obtained by Formula 23 in the case of θx≠90.

$\begin{matrix} {{\theta_{x} = {\sin^{- 1}\left( {- P_{23}} \right)}}{\theta_{y} = {\tan^{- 1}\frac{P_{31}}{P_{33}}}}\theta_{z} = {\tan^{- 1}\frac{P_{21}}{P_{22}}}} & \left\lbrack {{Formula}\mspace{14mu} 23} \right\rbrack \end{matrix}$

In the case of θx=90, Formula 24 is obtained when θy=0.

$\begin{matrix} {{\theta_{x} = {\sin^{- 1}\left( {- P_{23}} \right)}}{\theta_{y} = 0}{\theta_{z} = {\tan^{- 1}\left( {- \frac{P_{12}}{P_{11}}} \right)}}} & \left\lbrack {{Formula}\mspace{14mu} 24} \right\rbrack \end{matrix}$

When a position matrix Po is formed based on the rotation angle obtained by the equations, Po has the orthogonality.

At this point, the angle is obtained only from P₂₁, P₂₂, P₂₃, P₃₁, P₃₃ or P₁₁, P₁₂, P₂₃. Accordingly, the projection result onto the screen with the position matrix Po is different from the projection result onto the screen with the position matrix P. Therefore, these angles are set at the initial values, and the angle θ is finely adjusted such that the error between the position at the projected point and the pixel position on the image is minimized, whereby the error is minimized while the orthogonality is maintained.

It is assumed that the four points are projected as expressed in Formula 25 by the position matrix Po. (X ₁ ,Y ₁,0)→(u′ ₁ ,v′ ₁) (X ₂ ,Y ₂,0)→(u′ ₂ ,v′ ₂) (X ₃ ,Y ₃,0)→(u′ ₃ ,v′ ₃) (X ₄ ,Y ₄,0)→(u′ ₄ ,v′ ₄)  [Formula 25]

At this point, the sum of squares of a distance between the position at the point onto which the error E is projected and the pixel position on the image is expressed by Formula 26:

$\begin{matrix} {E = {\sum\limits_{i}\left( {\left( {u_{i}^{\prime} - u_{i}} \right)^{2} + \left( {v_{i}^{\prime} - v_{i}} \right)^{2}} \right)}} & \left\lbrack {{Formula}\mspace{14mu} 26} \right\rbrack \end{matrix}$

θx, θy, θz and P₃₄ are adjusted by a gradient technique such that the error E becomes the minimum.

P₁₄ and P₂₄ are not changed because P₁₄ and P₂₄ are redundant as described later. Thus, the position matrix P can be transformed into the matrix having the orthogonality.

The position matrix P can also be expressed in the form in which a matrix R having an element of an infinitesimal rotation angle Δθ is separated.

$\begin{matrix} \begin{matrix} {P = \begin{pmatrix} P_{11} & P_{12} & P_{13} & P_{14} \\ P_{21} & P_{22} & P_{23} & P_{24} \\ P_{31} & P_{32} & P_{33} & P_{34} \end{pmatrix}} \\ {= \begin{pmatrix} \begin{matrix} {{\cos\;\theta_{y}\cos\;\theta_{z}} +} \\ {\sin\;\theta_{x}\sin\;\theta_{y}\sin\;\theta_{z}} \end{matrix} & \begin{matrix} {{{- \cos}\;\theta_{y}\sin\;\theta_{z}} +} \\ {\sin\;\theta_{x}\sin\;\theta_{y}\cos\;\theta_{z}} \end{matrix} & {\cos\;\theta_{x}\sin\;\theta_{y}} & P_{14} \\ {\cos\;\theta_{x}\sin\;\theta_{z}} & {\cos\;\theta_{x}\cos\;\theta_{z}} & {{- \sin}\;\theta_{x}} & P_{24} \\ \begin{matrix} {{{- \sin}\;\theta_{y}\cos\;\theta_{z}} +} \\ {\sin\;\theta_{x}\cos\;\theta_{y}\sin\;\theta_{z}} \end{matrix} & \begin{matrix} {{\sin\;\theta_{y}\sin\;\theta_{z}} +} \\ {\sin\;\theta_{x}\cos\;\theta_{y}\cos\;\theta_{z}} \end{matrix} & {\cos\;\theta_{x}\cos\;\theta_{y}} & P_{34} \end{pmatrix}} \\ {= {R \cdot P^{\prime}}} \\ {= \begin{pmatrix} \begin{matrix} {{\cos\;{\Delta\theta}_{y}\cos\;\Delta\;\theta_{z}} +} \\ {\sin\;{\Delta\theta}_{x}\sin\;{\Delta\theta}_{y}\sin\;\Delta\;\theta_{z}} \end{matrix} & \begin{matrix} {{{- \cos}\;{\Delta\theta}_{y}\sin\;\Delta\;\theta_{z}} +} \\ {\sin\;{\Delta\theta}_{x}\sin\;\Delta\;\theta_{y}\cos\;\Delta\;\theta_{z}} \end{matrix} & {\cos\;\Delta\;\theta_{x}\sin\;\Delta\;\theta_{y}} \\ {\cos\;{\Delta\theta}_{x}\sin\;{\Delta\theta}_{z}} & {\cos\;\Delta\;\theta_{x}\cos\;\Delta\;\theta_{z}} & {{- \sin}\;{\Delta\theta}_{x}} \\ \begin{matrix} {{{- \sin}\;{\Delta\theta}_{y}\cos\;\Delta\;\theta_{z}} +} \\ {\sin\;{\Delta\theta}_{x}\cos\;{\Delta\theta}_{y}\sin\;\Delta\;\theta_{z}} \end{matrix} & \begin{matrix} {{\sin\;{\Delta\theta}_{y}\sin\;{\Delta\theta}_{z}} +} \\ {\sin\;{\Delta\theta}_{x}\cos\;{\Delta\theta}_{y}\cos\;{\Delta\theta}_{z}} \end{matrix} & {\cos\;\Delta\;\theta_{x}\cos\;\Delta\;\theta_{y}} \end{pmatrix}} \\ {\begin{pmatrix} \begin{matrix} {{\cos\;\theta_{y}^{\prime}\cos\;\theta_{z}^{\prime}} +} \\ {\sin\;\theta_{x}^{\prime}\sin\;\theta_{y}^{\prime}\sin\;\theta_{z}^{\prime}} \end{matrix} & \begin{matrix} {{{- \cos}\;\theta_{y}^{\prime}\sin\;\theta_{z}^{\prime}} +} \\ {\sin\;\theta_{x}^{\prime}\sin\;\theta_{y}^{\prime}\cos\;\theta_{z}^{\prime}} \end{matrix} & {\cos\;\theta_{x}^{\prime}\sin\;\theta_{y}^{\prime}} & P_{14} \\ {\cos\;\theta_{x}^{\prime}\sin\;\theta_{z}^{\prime}} & {\cos\;\theta_{x}^{\prime}\cos\;\theta_{z}^{\prime}} & {{- \sin}\;\theta_{x}^{\prime}} & P_{24} \\ \begin{matrix} {{{- \sin}\;\theta_{y}^{\prime}\cos\;\theta_{z}^{\prime}} +} \\ {\sin\;\theta_{x}^{\prime}\cos\;\theta_{y}^{\prime}\sin\;\theta_{z}^{\prime}} \end{matrix} & \begin{matrix} {{\sin\;\theta_{y}^{\prime}\sin\;\theta_{z}^{\prime}} +} \\ {\sin\;\theta_{x}^{\prime}\cos\;\theta_{y}^{\prime}\cos\;\theta_{z}^{\prime}} \end{matrix} & {\cos\;\theta_{x}^{\prime}\cos\;\theta_{y}^{\prime}} & P_{34} \end{pmatrix}} \end{matrix} & \left\lbrack {{Formula}\mspace{14mu} 27} \right\rbrack \end{matrix}$

Since cos θ 1 and sin θ θ in the case of Δθ<<1, Formula 28 is obtained.

$\begin{matrix} {{P = \begin{pmatrix} {\; 1} & {{- \Delta}\;\theta_{z}} & {\Delta\theta}_{y} \\ {\Delta\;\theta_{z}} & 1 & {{- \Delta}\;\theta_{x}} \\ {{- \Delta}\;\theta_{y}} & {\Delta\;\theta_{x}} & 1 \end{pmatrix}}\left( \begin{matrix} \begin{matrix} {{\cos\;\theta_{y}^{\prime}\cos\;\theta_{z}^{\prime}} +} \\ {\sin\;\theta_{x}^{\prime}\sin\;\theta_{y}^{\prime}\sin\;\theta_{z}^{\prime}} \end{matrix} & \begin{matrix} {{{- \cos}\;\theta_{y}^{\prime}\sin\;\theta_{z}^{\prime}} +} \\ {\sin\;\theta_{x}^{\prime}\sin\;\theta_{y}^{\prime}\cos\;\theta_{z}^{\prime}} \end{matrix} & {\cos\;\theta_{x}^{\prime}\sin\;\theta_{y}^{\prime}} & P_{14} \\ {\cos\;\theta_{x}^{\prime}\sin\;\theta_{z}^{\prime}} & {\cos\;\theta_{x}^{\prime}\cos\;\theta_{z}^{\prime}} & {{- \sin}\;\theta_{x}^{\prime}} & P_{24} \\ \begin{matrix} {{{- \sin}\;\theta_{y}^{\prime}\cos\;\theta_{z}^{\prime}} +} \\ {\sin\;\theta_{x}^{\prime}\cos\;\theta_{y}^{\prime}\sin\;\theta_{z}^{\prime}} \end{matrix} & \begin{matrix} {{\sin\;\theta_{y}^{\prime}\sin\;\theta_{z}^{\prime}} +} \\ {\sin\;\theta_{x}^{\prime}\cos\;\theta_{y}^{\prime}\cos\;\theta_{z}^{\prime}} \end{matrix} & {\cos\;\theta_{x}^{\prime}\cos\;\theta_{y}^{\prime}} & P_{34} \end{matrix} \right)} & \left\lbrack {{Formula}\mspace{14mu} 28} \right\rbrack \end{matrix}$

Hereinafter the transformed position matrix is referred to as position matrix P.

In the above-described matrix, the error E may be minimized by adjusting Δθx, Δθy, Δθz and P₁₄, P₂₄, P₃₄.

As can be seen from the matrix R, Δθx and Δθy becomes the translation component during the infinitesimal rotation, changing the elements P₁₄ and P₂₄ of the translation is redundant and becomes an obstacle of convergence. Therefore, the elements P₁₄ and P₂₄ are not changed. That is, the error E is minimized by adjusting Δθx, Δθy, Δθz, and P₃₄.

Non-Pinhole Characteristic Correcting Method

A non-pinhole characteristic correcting method performed by the object position estimating means 105 will be described below.

The pinhole characteristic means a characteristic in which, in the camera, all the incident rays pass through a pinhole at one point to form the image. The method for obtaining the position matrix to estimate the object position is based on the pinhole characteristic of the camera. However, the light actually incident to the camera does not have the pinhole characteristic, but does have a non-pinhole characteristic because the light passes through a lens.

FIG. 4 is a view for explaining the non-pinhole characteristic of the camera. For the sake of simple explanation, a glass plate 201 is used instead of the lens. Referring to FIG. 4, the glass plate 201 having a thickness t is placed on the object side of a pinhole C. The light from a point M on the object is refracted by the glass plate 201, and the light is projected onto a point m on a screen 203 after passing through the pinhole C. The position of the point m corresponds to the measured pixel position.

Because the method for estimating the object position by obtaining the position matrix is based on the pinhole characteristic of the camera, it is determined that the point M is a position of a point M′ on a straight line connecting the point m and the pinhole C. Accordingly, when the object position is estimated without considering the non-pinhole characteristic of the camera, the error is generated due to the position distance between the point M and the point M′.

A method for obtaining the object position estimated in consideration of the non-pinhole characteristic of the camera will be described below.

FIG. 3 is a flowchart illustrating the method in which the object position estimating means 105 obtains the object position estimated in consideration of the non-pinhole characteristic of the camera.

In Step S3010 of FIG. 3, the object position estimating means 105 obtains the position matrix P indicating the rotation and translation of the object from the plural points on the object that are in the known positional relationship without considering the non-pinhole characteristic of the camera. The estimation is performed using the positional relationship and the measured pixel positions in the image of the plural points. The method for obtaining the position matrix P is already described in the “method for obtaining position matrix having orthogonality”. The position matrix that is obtained without considering the non-pinhole characteristic of the camera corresponds to the position of the point M′ of FIG. 4.

In Step S3020 of FIG. 3, the object position estimating means 105 obtains calibration data corresponding to the measured pixel position (position of m). The calibration data is stored in the calibration data storage means 107. Then the object position estimating means 105 obtains a corrected pixel position using the position matrix P and the calibration data.

The calibration data in which the characteristic of the non-pinhole camera is digitized will be described below.

FIG. 10 is an explanatory view for explaining contents of the calibration data. As illustrated in FIG. 10, an incident ray R incident to a lens 1 can be specified at two points. At this point, when light emitted from a first light source position P1 and light emitted from a second light source position P2 are taken by the same imaging pixel (not illustrated), it is specified that the incident ray R is an incident ray corresponding to the imaging pixel.

It is defined that an optical center O is a point at which the sum of squares of the distances with all the incident rays becomes the minimum, and it is defined that an incident light base point B of the incident ray R is a point at which the distance between the incident ray R corresponding to each imaging pixel and the optical center O becomes the minimum.

That is, in all the incident rays, the optical center O(x₀,y₀,z₀) is the position at which the sum of squares (Equation (1)) of a distance d from the incident ray R specified by the light source position P1(x₁,y₁,z₁) and the light source position P2(x₂,y₂,z₂) becomes the minimum. The optical point is obtained by a least square method. d ²=−(A ² /B)+C  (1) In Equation (1), A=(x ₂ −x ₁)(x ₁ −x ₀)+(y ₂ −y ₁)(y ₁ −y ₀)+(z ₂ −z ₁)(z ₁ −z ₀) B=(x ₂ −x ₁)²+(y ₂ −y ₁)²+(z ₂ −z ₁)² C=(x ₁ −x ₀)²+(y ₁ −y ₀)²+(z ₁ −z ₀)²

Therefore, the data in which a direction specified by the light source positions P1 and P2 and a deviation amount (expressed by three-dimensional vector V_(D) (dx,dy,dz)) from the optical center O to the incident light base point B are correlated to each other is set to the calibration data at each pixel position, which allows the characteristic of the non-pinhole camera to be digitized.

The calibration data is not limited to this. For example, in the above-described embodiment, the optical center O is set at the reference position, and a vector from the reference position to a foot of the perpendicular dropped from the optical center O to the incident ray is set at the deviation amount V_(D). The reference position is not limited to the optical center, but any fixed point may be set at the reference position as long as the fixed point has a constant relationship with the camera. The deviation amount V_(D) is not limited to the vector from the reference position to the foot of the perpendicular dropped from the optical center O to the incident ray, but a vector from the reference position toward an arbitrary one point on the incident ray may be used as the deviation amount V_(D).

In the embodiment, the pinhole is set at the reference position, and the base point is expressed by B.

Thus, the calibration data is the data in which the direction of the incident ray R and the deviation amount from the reference position to the base point are correlated with the pixel position, and the calibration data can be obtained by the measurement. The calibration data for each pixel position obtained by the measurement is stored in the calibration data table 107.

FIG. 5 is a view for explaining a method for obtaining the corrected pixel position (hereinafter referred to as corrected pixel position 1, position of m′) through a first correction. A base point position (position of B) is obtained from the calibration data corresponding to the measured pixel position (position of m). Then a straight line connecting the base point position (position of B) and the point M′ is obtained. The point M′ is obtained from the position matrix P. A straight line that is parallel to the straight line connecting the base point position (position of B) and the point M′ and passes through the pinhole position (position of C) is obtained, and an intersection point of the straight line with the screen 203 is set at the corrected pixel position (position of m′).

In Step S3030, the object position estimating means 105 determines whether or not the distance between the corrected pixel position (position of m′) and the measured pixel position (position of m) falls within an allowable range. For example, the allowable range is set at ±0.05 pixel. When the distance does not fall within the allowable range, the flow goes to Step S3040. When the distance falls within the allowable range, the flow goes to Step S3050.

In Step S3040 of FIG. 3, the object position estimating means 105 adjusts the position matrix such that the corrected pixel position is brought close to the measured pixel position.

FIG. 6 is a view for explaining a method for obtaining the corrected pixel position (hereinafter referred to as corrected pixel position 2, position of m″) through a second correction. Because the corrected pixel position 1 (position of m′) is located below the measured pixel position (position of m), it is necessary that the corrected pixel position be moved upward (direction in which the X-coordinate is increased). Therefore, for example, the point M′ is moved rightward (direction in which the Z-coordinate is increased). Specifically, Δθx, Δθy, Δθz, and P₃₄ of the position matrix P are adjusted to move the point M′ rightward (direction in which the Z-coordinate is increased), thereby obtaining the point M″.

After the processing in Step S3040 is performed, the object position estimating means 105 performs the processing in Step S3020.

The processing in Step S3020 will be described with reference to FIG. 6. A base point position (position of B′) is obtained from the calibration data corresponding to the corrected pixel position 1 (position of m′). Then a straight line connecting the base point position (position of B′) and the point M″ is obtained. The point M″ is obtained from the adjusted position matrix P as described above. A straight line that is parallel to the straight line connecting the base point position (position of B′) and the point M″ and passes through the pinhole position (position of C), and an intersection point of the straight line with the screen 203 is set at the corrected pixel position 2 (position of m″).

Similarly the object position estimating means 105 repeats the processing in Steps S3040 and S3020 until the distance between the corrected pixel position and the measured pixel position (position of m) falls within the allowable range.

In the repetitive computation, an adjustment amount of the position matrix P is obtained in consideration of the movement amount of the corrected pixel position with respect to the adjustment amount of the position matrix P.

FIG. 7 is a view for explaining a method for obtaining a corrected pixel position (hereinafter referred to as corrected pixel position 3, position of m′″) through a third correction. The distance between the corrected pixel position 3 (position of m′″) and the measured pixel position (position of m) falls within the allowable range.

In Step S3050, the object position estimating means 105 sets the position corresponding to the position matrix P at the object position estimated in consideration of the non-pinhole characteristic of the camera. The position corresponding to the position matrix P is adjusted such that the distance between the corrected pixel position (position of m′″) and the measured pixel position (position of m) falls within the allowable range.

FIG. 8 is a view illustrating an error that is generated when the position is detected without considering the non-pinhole characteristic of the camera while the plate glass is placed in front of the pinhole. For example, the position M of a marker (point) on the object is located in the plane perpendicular to the Z-axis of FIG. 4 and at one of the four vertexes of a square which has one side of 0.1 meter and the diagonal lines of which intersect with each other on the Z-axis. The horizontal axis indicates a distance (in meters) in the Z-axis direction from the pinhole position (position of C) to the point M on the object of FIG. 4. The vertical axis indicates a normalized value (unit: 1/meter) in which the distance between the position of the point M on the object and the estimated position (position of M′) is divided by the square of the distance in the Z-axis direction of FIG. 4, that is, a normalized error. At this point, the standard deviation indicates a dispersion of the normalized error. The data is calibrated at the distance of one meter in the Z-axis direction from the pinhole position (position of C) to the point M on the object.

A horizontal view angle of the camera is set at 90 degrees, a horizontal pixel is set at 640 pixels, and an aspect ratio is set at 1:1.

FIG. 8 illustrates errors when the glass plate has thicknesses t of 3 millimeters, 6 millimeters, 9 millimeters, and 12 millimeters. The normalized error is rapidly increased when the distance in the Z-axis direction from the pinhole position (position of C) to the point M on the object is smaller than one meter.

FIG. 9 is a view illustrating an error that is generated when the position is detected by a position detecting method of the invention on the same condition as that of FIG. 8. The error is not increased even if the distance in the Z-axis direction from the pinhole position (position of C) to the point M on the object is smaller than one meter.

Thus, according to the position detecting method of the invention, the object position can be detected with high accuracy even if the object is located in the neighborhood. 

1. A position detecting method for detecting a position or an attitude of an object from measured pixel positions in an image of a plurality of points on the object in consideration of a non-pinhole characteristic of a camera, the image being taken with one camera, the plurality of points on the object being in a known positional relationship, the position detecting method comprising the steps of: obtaining a position matrix indicating rotation and translation of the object from the measured pixel positions and a positional relationship between the plurality of points without considering the non-pinhole characteristic of the camera; obtaining a corrected pixel position corresponding to one of the measured pixel positions in consideration of the non-pinhole characteristic of the camera; adjusting the position matrix such that a distance between the corrected pixel position and the measured pixel position falls within an allowable range; and setting a position corresponding to the position matrix as the object position estimated in consideration of the non-pinhole characteristic of the camera, the position matrix being adjusted such that the distance between the corrected pixel position and the measured pixel position falls within an allowable range.
 2. The position detecting method according to claim 1, wherein an element of the position matrix is adjusted so as to have orthogonality, the element expressing the rotation of the object.
 3. The position detecting method according to claim wherein correction for the non-pinhole characteristic of the camera is performed using calibration data defined for each pixel position.
 4. A position detecting apparatus that detects a position or an attitude of an object, the position detecting apparatus comprising: image obtaining means for obtaining an image of a plurality of points on the object, the image being taken with one camera, the plurality of points being in a known positional relationship; pixel position detecting means for detecting measured pixel positions of the plurality of points in the image; and object position estimating means for detecting the object position from the measured pixel positions of the plurality of points and a positional relationship between the plurality of points, the object position estimating means obtains a position matrix indicating rotation and translation of the object from the measured pixel position and a positional relationship between the plurality of points without considering the non-pinhole characteristic of the camera, obtains a corrected pixel position corresponding to one of the measured pixel positions in consideration of the non-pinhole characteristic of the camera, adjusts the position matrix such that a distance between the corrected pixel position and the measured pixel position falls within an allowable range, and sets a position corresponding to the position matrix as the object position estimated in consideration of the non-pinhole characteristic of the camera, the position matrix being adjusted such that the distance between the corrected pixel position and the measured pixel position falls within an allowable range.
 5. The position detecting apparatus according to claim 4, further comprising calibration data storage means in which calibration data defined for each pixel position is stored, the object position estimating means performs correction for the non-pinhole characteristic of the camera using the calibration data. 